using Gateway.Common.Entity;

namespace Gateway.Domain.Entities;

/// <summary>
/// 运行语言
/// </summary>
public class Language : AggregateRootEntityBase
{
    public Language(string lang = default, string text = default, string build = default, string buildCommand = default,
        string exec = default, string execCommand = default, string langType = default)
    {
        Lang = lang;
        Text = text;
        Build = build;
        BuildCommand = buildCommand;
        Exec = exec;
        ExecCommand = execCommand;
        LangType = langType;
    }

    /// <summary>
    /// 语言类型 csharp java c c++ 等
    /// </summary>
    public string Lang { get; private set; }

    /// <summary>
    /// 名称-显示
    /// </summary>
    public string Text { get; private set; }

    /// <summary>
    /// 构建使用的主命令
    /// </summary>
    public string Build { get; private set; }

    /// <summary>
    /// 构建使用的命令
    /// </summary>
    public string BuildCommand { get; private set; }

    /// <summary>
    /// 执行的主命令
    /// </summary>
    public string Exec { get; private set; }

    /// <summary>
    /// 执行的使用的命令
    /// </summary>
    public string ExecCommand { get; private set; }

    /// <summary>
    /// 语言的编译类型   Compiled 编译型  Interpretation 解释型
    /// </summary>
    public string LangType { get; private set; }

    /// <summary>
    /// 扩展类库
    /// </summary>
    public List<LanguageExtensionCode> Codes { get; set; }

    public Language()
    {
    }

    public void Update(string lang = default, string text = default, string build = default,
        string buildCommand = default,
        string exec = default, string execCommand = default, string langType = default)
    {
        Lang = lang;
        Text = text;
        Build = build;
        BuildCommand = buildCommand;
        Exec = exec;
        ExecCommand = execCommand;
        LangType = langType;
    }
}